'\"macro stdmacro
.\"
.\" Copyright (c) 2016,2019 Red Hat.
.\" Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PMSTAT 1 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pcp-vmstat\f1,
\f3pmstat\f1 \- high-level system performance overview
.SH SYNOPSIS
\f3pcp\f1 [\f2pcp\ options\f1] \f3vmstat\f1 [\f2interval\f1 [\f2samples\f1]]
.P
\f3pmstat\f1
[\f3\-gLlPxz?\f1]
[\f3\-a\f1 \f2archive\f1]
[\f3\-A\f1 \f2align\f1]
[\f3\-h\f1 \f2host\f1]
[\f3\-H\f1 \f2file\f1]
[\f3\-n\f1 \f2pmnsfile\f1]
[\f3\-O\f1 \f2offset\f1]
[\f3\-p\f1 \f2port\f1]
[\f3\-s\f1 \f2samples\f1]
[\f3\-S\f1 \f2starttime\f1]
[\f3\-t\f1 \f2interval\f1]
[\f3\-T\f1 \f2endtime\f1]
[\f3\-Z\f1 \f2timezone\f1]
.sp
\f3pcp-vmstat\f1
\&...
.SH DESCRIPTION
.de SAMPLE
.RS 2n
.nf
.nh
..
.de ESAMPLE
.hy
.fi
.RE
..
.B pmstat
provides a one line summary of system performance every
.I interval
unit of time (the default is 5 seconds).
.B pmstat
is intended to monitor system performance at the highest level,
after which other tools may be used to examine subsystems in which
potential performance problems may be observed in greater detail.
.P
.B pcp-vmstat
is a simple wrapper for use with the
.BR pcp (1)
command, providing a more familiar command line format for some
users.
It also enables the extended reporting option by default, see the
.I \-x
option below.
.P
Multiple hosts may be monitored by supplying more than
one host with multiple
.B \-h
flags (for live monitoring) or by providing a name of the hostlist file, where
each line contain one host name, with
.B \-H,
or multiple
.B \-a
flags (for retrospective monitoring from sets of archives).
.PP
By default,
.B pmstat
fetches metrics by connecting to the Performance Metrics Collector
Daemon (PMCD) on the local host.
If the
.B \-L
option is specified, then
.BR pmcd (1)
is bypassed, and metrics are fetched from PMDAs on the local host
using the standalone
.B PM_CONTEXT_LOCAL
variant of
.BR pmNewContext (3).
When the
.B \-h
option is specified,
.B pmstat
connects to the
.BR pmcd (1)
on
.I host
and fetches metrics from there.
As mentioned above, multiple hosts may be monitored
by supplying multiple
.B \-h
flags.
.PP
Alternatively, if the
.B \-a
option is used, the metrics are retrieved from the Performance Co-Pilot
archive log files identified by
.IR archive ,
which is a comma-separated list of names, each
of which may be the base name of an archive or the name of a directory containing
one or more archives.
Multiple sets of archives may be replayed by supplying multiple
.B \-a
flags.
When the
.B \-a
flag is used,
the
.B \-P
flag may also be used to pause the output after each interval.
.PP
Standalone mode can only connect to the local host, using a set of archives implies
a host name, and nominating a host precludes using an archive, so the options
.BR \-L ,
.B \-a
and
.B \-h
are mutually exclusive.
.PP
.B pmstat
may relinquish its own timing control, and operate under the control of a
.BR pmtime (1)
process that uses a GUI dialog to provide timing control.
In this case, either the
.B \-g
option should be used to start
.B pmstat
as the sole client of a new
.BR pmtime (1)
instance, or
.B \-p
should be used to attach
.B pmstat
to an existing
.BR pmtime (1)
instance via the IPC channel identified by the
.I port
argument.
.PP
The
.BR \-S ,
.BR \-T ,
.BR \-O
and
.B \-A
options may be used to define a time window to restrict the
samples retrieved, set an initial origin within the time window,
or specify a ``natural'' alignment of the sample times; refer to
.BR PCPIntro (1)
for a complete description of these options.
.SH OPTIONS
The available command line options are:
.TP 5
\fB\-a\fR \fIarchive\fR, \fB\-\-archive\fR=\fIarchive\fR
Performance metric values are retrieved from the set of Performance
Co-Pilot (PCP) archive log files identified by the
.I archive
argument, which is a comma-separated list of names,
each of which may be the base name of an archive or the name of
a directory containing one or more archives.
.TP
\fB\-A\fR \fIalign\fR, \fB\-\-align\fR=\fIalign\fR
Force the initial sample to be
aligned on the boundary of a natural time unit
.IR align .
Refer to
.BR PCPIntro (1)
for a complete description of the syntax for
.IR align .
.TP
\fB\-g\fR, \fB\-\-guimode\fR
Start
.B pmstat
as the client of a new
.BR pmtime (1)
server process for replay of archived performance data using the
.BR pmtime (1)
graphical user interface.
.TP
\fB\-h\fR \fIhost\fR, \fB\-\-host\fR=\fIhost\fR
Fetch performance metrics from
.BR pmcd (1)
on
.IR host ,
rather than from the default localhost.
.TP
\fB\-H\fR \fIpath\fR, \fB\-\-hostsfile\fR=\fIpath\fR
Specify the
.I path
to a file containing a set of hostnames where
.BR pmcd (1)
is running ,
rather than using the default localhost.
.TP
\fB\-K\fR \fIspec\fR, \fB\-\-spec\-local\fR=\fIspec\fR
When fetching metrics from a local context (see
.BR \-L ),
the
.B \-K
option may be used to control the DSO PMDAs that should be made accessible.
The
.I spec
argument conforms to the syntax described in
.BR pmSpecLocalPMDA (3).
More than one
.B \-K
option may be used.
.TP
\fB\-l\fR, \fI\-\-suffix\fR
Prints the last 7 characters of a hostname in summaries involving
more than one host (when more than one
.B \-h
option has been specified on the command line).
.TP
\fB\-L\fR, \fB\-\-local\-PMDA\fR
Use a local context to collect metrics from DSO PMDAs on the local host
without PMCD.
See also
.BR \-K .
.TP
\fB\-n\fR \fIpmnsfile\fR, \fB\-\-namespace\fR=\fIpmnsfile\fR
Load an alternative Performance Metrics Name Space
.RB ( PMNS (5))
from the file
.IR pmnsfile .
.TP
\fB\-O\fR \fIorigin\fR, \fB\-\-origin\fR=\fIorigin\fR
When reporting archived metrics, start reporting at
.I origin
within the time window (see
.B \-S
and
.BR \-T ).
Refer to
.BR PCPIntro (1)
for a complete description of the syntax for
.IR origin .
.TP
\fB\-p\fR \fIport\fR, \fB\-\-guiport\fR=\fIport\fR
Attach
.B pmstat
to an existing
.BR pmtime (1)
time control process instance via the IPC channel identified by the
\f2port\f1 argument.
This option is normally only used by other tools, e.g.
.BR pmchart (1),
when they launch
.B pmstat
with synchronized time control.
.TP
\fB\-s\fR \fIsamples\fR, \fB\-\-samples\fR=\fIsamples\fR
The
.I samples
option defines the number of samples to be retrieved and reported.
If
.I samples
is 0 or
.B \-s
is not specified,
.B pmstat
will sample and report continuously \- this is the default behavior.
.TP
\fB\-S\fR \fIstarttime\fR, \fB\-\-start\fR=\fIstarttime\fR
When reporting archived metrics, the report will be restricted to those
records logged at or after
.IR starttime .
Refer to
.BR PCPIntro (1)
for a complete description of the syntax for
.IR starttime .
.TP
\fB\-t\fR \fIinterval\fR, \fB\-\-interval\fR=\fIinterval\fR
Set the reporting
.I interval
to something other than the default 1 second.
The
.I interval
argument follows the syntax described in
.BR PCPIntro (1),
and in the simplest form may be an unsigned integer
(the implied units in this case are seconds).
.TP
\fB\-T\fR \fIendtime\fR, \fB\-\-finish\fR=\fIendtime\fR
When reporting archived metrics, the report will be restricted to those
records logged before or at
.IR endtime .
.TP
\fB\-x\fR, \fI\-\-xcpu\fR
The extended CPU metrics option, causes two additional CPU metrics to be
reported, namely wait for I/O ("wa") and virtualisation steal time ("st").
.TP
\fB\-z\fR, \fB\-\-hostzone\fR
Change the reporting timezone to the local timezone at the host
that is the source of the performance metrics, as identified via
either the
.B \-h
or
.B \-a
options.
.TP
\fB\-Z\fR \fItimezone\fR, \fB\-\-timezone\fR=\fItimezone\fR
By default,
.B pmtime
reports the time of day according to the local timezone on the system
where
.B pmstat
is run.
The
.B \-Z
option changes the timezone to
.I timezone
in the format of the environment variable TZ as described in
.BR environ (7).
.SH OUTPUT
The output from
.B pmstat
is directed to standard output, and the columns
in the report are interpreted as follows:
.TP 10
.B loadavg
The
.I "1 minute"
load average.
.TP
.B memory
The \f3swpd\fP column indicates average swap space used during the interval,
in Kbytes.
The \f3free\fP column indicates average free memory during the interval,
in Kbytes.
The \f3buff\fP column indicates average buffer memory in use during the interval,
in Kbytes.
The \f3cache\fP column indicates average cached memory in use during the interval,
in Kbytes.
.RS
.PP
If the values become large, they are reported as Mbytes
.BR "" ( m " suffix)"
or Gbytes
.BR "" ( g " suffix)."
.RE
.TP
.B swap
The metrics in this area of the kernel instrumentation are of
varying value.
We try to report the average number of \f3pages\fP
that are paged in (\f3pi\fP) and out (\f3po\fP) per second during
the interval.
If the corresponding page swapping metrics are unavailable, we report
the average rate per second
of swap \f3operations\fP in (\f3si\fP) and out (\f3so\fP) during the interval.
It is normal for the ``in'' values to be non-zero, but the system
is suffering memory stress if the ``out'' values are non-zero over
an extended period.
.RS
.PP
If the values become large, they are reported as thousands of
operations per second
.BR "" ( K " suffix)"
or millions of operations per second
.BR "" ( M " suffix)."
.RE
.TP
.B io
The \f3bi\fP and \f3bo\fP columns indicate the average rate per second
of block input and block output operations (respectfully) during the interval.
Unless all file systems have a 1 Kbyte block size, these
rates do not directly indicate Kbytes transferred.
.RS
.PP
If the values become large, they are reported as thousands of
operations per second
.BR "" ( K " suffix)"
or millions of operations per second
.BR "" ( M " suffix)."
.RE
.TP
.B system
Interrupt rate (\f3in\fP) and
context switch rate (\f3cs\fP).
Rates are expressed as average operations per second during the interval.
Note that the interrupt rate is normally at least
.I HZ
(the clock interrupt rate, usually 100)
interrupts per second.
.RS
.PP
If the values become large, they are reported as thousands of
operations per second
.BR "" ( K " suffix)"
or millions of operations per second
.BR "" ( M " suffix)."
.RE
.TP
.B cpu
Percentage of CPU time spent executing user and "nice user" code (\f3us\fP),
system and interrupt processing code (\f3sy\fP), idle loop (\f3id\fP).
.P
If any values for the associated performance metrics are unavailable,
the value appears as ``?'' in the output.
.SH DIAGNOSTICS
All are generated on standard error and are intended to be self-explanatory.
.SH FILES
.TP 5
.I $PCP_VAR_DIR/pmns/*
default PMNS specification files
.TP
.I $PCP_VAR_DIR/config/pmlogger/config.pmstat
.BR pmlogger (1)
configuration for creating an archive suitable for replay with
.B pmstat
.SH PCP ENVIRONMENT
Environment variables with the prefix \fBPCP_\fP are used to parameterize
the file and directory names used by PCP.
On each installation, the
file \fI/etc/pcp.conf\fP contains the local values for these variables.
The \fB$PCP_CONF\fP variable may be used to specify an alternative
configuration file, as described in \fBpcp.conf\fP(5).
.PP
For environment variables affecting PCP tools, see \fBpmGetOptions\fP(3).
.SH SEE ALSO
.BR PCPIntro (1),
.BR pmclient (1),
.BR pmtime (1),
.BR PMAPI (3),
.BR pmNewContext (3),
.BR pcp.conf (5),
.BR pcp.env (5)
and
.BR PMNS (5).
